﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using DevExpress.LookAndFeel;

namespace PRO_DOCS.DocumentManagementSystem.ADMIN.WIN
{
    static class Program
    {
        public static Timer CurrentAppTimer
        { get; set; }

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.UserSkins.BonusSkins.Register();


            UserLookAndFeel.Default.SetSkinStyle("Office 2010 Blue");
            CurrentAppTimer = new Timer();
            CurrentAppTimer.Interval = 60000;
            CurrentAppTimer.Enabled = true;
            CurrentAppTimer.Tick += new EventHandler(CurrentAppTimer_Tick);

            Application.Run(new PRO_DOCS.BLL.WIN.Authentication.SigningIn());

            if (PRO_DOCS.BLL.WIN.Authentication.LOGGED_IN_EMPLOYEE_DETAILS.IS_AUTHENTICATED_USER)
            {
                CurrentAppTimer.Start();
                Application.Run(new MainForm());

                PRO_DOCS.BLL.WIN.Authentication.LoggedInEmployeeSession.CLOSE_LOGGED_IN_USER_SESSION();
            }
        }


        static void CurrentAppTimer_Tick(object sender, EventArgs e)
        {
            PRO_DOCS.BLL.WIN.Authentication.LoggedInEmployeeSession.UPDATE_CHECK_IN_LOGGED_IN_USER_SESSION();
        }
    }
}